home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / AmigaOS / Aplus_Dev / AP-Website / download / whirlgui / whirlgui01.lha / WhirlGui < prev   
Encoding:
Text File  |  2001-01-29  |  5.5 KB  |  237 lines

  1. /* FREEWARE - Torsten Dudai, 2001 */
  2.  
  3. Anzahl=0
  4. transparenz=0
  5. disp="none"
  6. savefile=""
  7. transval=0
  8. loopval=0
  9. kopieval=1
  10.  
  11. call open(ca,'awnpipe:test/xc')
  12. call topipe('st "WhirlGUI for AMIGA plus 03/2001 (by T.D., Bug-Reports to torsten@dudai.de)" title "WhirlGUI  V 0.1" defg v m')
  13.  
  14. call topipe('layout si so b 0 weih 0')
  15.     newgad=topipe('button ab 0 weiw 0 weih 0 minw 20 minh 20')
  16.     gifgad=topipe('button gt "Anim" dis 1 minw 80 minh 20')
  17.     cleargad=topipe('button gt "Liste löschen" dis 1 minw 80 minh 20')
  18.     delgad=topipe('button gt "Entfernen" dis 1 minw 80 minh 20')
  19. call topipe('le')
  20.  
  21. call topipe('layout si so b 0 weih 0')
  22.     checkers=topipe('checkbox weiw 0 dis 1')
  23.     call topipe('label gt "Transp."')
  24.     transgad=topipe('integer maxc 3 minn 0 maxn 255 minw 50 a weiw 0 defn 0 dis 1')
  25.     call topipe('label gt "Ersetzen" weiw 0')
  26.     dispgad=topipe('chooser gt "Methode" pu cl "Keine|Nichts|Hintergrund|Vorheriges" minw 110 weih 0 dis 1')
  27. call topipe('le')
  28.  
  29. call topipe('layout si so b 0 weih 0')
  30.     call topipe('label gt "Wiederholen (0=unendlich)"')
  31.     loopgad=topipe('integer maxc 3 minn 0 maxn 999 minw 50 a weiw 0 defn 0 dis 1')
  32.     call topipe('label gt "Kopie"')
  33.     kopie=topipe('checkbox s 1 weiw 0')
  34. call topipe('le')
  35.  
  36. call topipe('layout si so h b 0 cj weih 0')
  37.     call topipe('label gt "Ziel-Anim"')
  38.     savegad=topipe('getfile gt "Wohin speichern?" i save dis 1')
  39. call topipe('le')
  40.  
  41.  
  42. call topipe('layout gt "Frames" si so v cj')
  43.     browser=topipe('listbrowser lbl "Pfad|Zeit" st minw 200 minh 100 dis 1')
  44. call topipe('le')
  45. filegad=topipe('getfile asl gt "GIF auswählen"')
  46. call topipe('open')
  47.  
  48.  
  49. /* main loop*/
  50.  
  51. do while ~eof(ca)
  52. call topipe('con')
  53.     in= readln(ca)
  54.     parse var in in1 in2 in3 in4 in5 .
  55.     if in1='gadget' then call gadget()
  56.     if in1='close' then do
  57.         if kopieval=1 then cleanUpTemp()
  58.         exit
  59.     end
  60. end
  61. exit
  62.  
  63.  
  64.  
  65. gadget:
  66. if in2=checkers then do
  67.     if in3=1 then do
  68.         call topipe('id 'transgad' dis 0 ref')
  69.         transparenz=1
  70.     end
  71.     else do
  72.         call topipe('id 'transgad' dis 1 ref')
  73.         transparenz=0
  74.     end
  75. end
  76. if in2=loopgad then loopval=in3
  77. if in2=transgad then transval=in3
  78. if in2=kopie then kopieval=in3
  79. if in2=savegad then do
  80.     savefile=in4 in5
  81.     testButtons()
  82. end
  83. if in2=dispgad then do
  84.     if in3=0 then disp="none"
  85.     if in3=1 then disp="not"
  86.     if in3=2 then disp="back"
  87.     if in3=3 then disp="prev"
  88. end
  89. if in2=gifgad then do
  90.     call readList()
  91.     Eingabe='whirlgif -o 'savefile' -loop 'loopval' -disp 'disp
  92.     if transparenz=1 then Eingabe=Eingabe||' -trans 'transval
  93.     do i=1 to Anzahl
  94.         Eingabe = Eingabe||' -time 'delay.i' 'pfad.i
  95.     end
  96.     echo Eingabe
  97.     address command Eingabe
  98. end
  99. if in2=newgad then do
  100.     call writeln(ca,'id 'filegad' s 1')
  101.     parse value readln(ca) with ok '"' filename '"'
  102.     if ok=0 then return(0)
  103.     Anzahl=Anzahl+1
  104.     testButtons()
  105.     if kopieval=1 then do
  106.         filename=getFilename(filename)
  107.     end
  108.     GID.Anzahl=topipe('id 'browser' addn gt="'filename'|^10" tar=-1')
  109.     Nr=GID.Anzahl
  110. end
  111. if in2=browser then do
  112.     Nr=in5
  113.     if in3=16 & in4=0 then do
  114.         call writeln(ca,'id 'Nr' read sort 1')
  115.         delay = readln(ca)
  116.         if kopieval=1 then do
  117.             call writeln(ca,'id 'Nr' read sort 0')
  118.             file = readln(ca)
  119.         end
  120.         call writeln(ca,'id 'filegad' s 1')
  121.         parse value readln(ca) with ok '"' pfad '"'
  122.         if ok~=0 then do
  123.             if kopieval=1 then do
  124.                 address command 'delete "'file'"'
  125.                 pfad=getFilename(pfad)
  126.             end
  127.             call topipe('id 'Nr' gt "'pfad'|^'delay'"')
  128.         end
  129.     end
  130. end
  131. if in2=cleargad then do
  132.     if kopieval=1 then call cleanUpTemp()
  133.     call topipe('id 'browser' remn')
  134.     Anzahl=0
  135.     testButtons()
  136. end
  137. if in2=delgad then do
  138.     call writeln(ca,'id 'Nr' read sort 0')
  139.     file = readln(ca)
  140.     if kopieval=1 then address command 'delete "'file'"'
  141.     call topipe('id 'Nr' remn')
  142.     Anzahl=Anzahl-1
  143.     call neuOrdnen(Nr)
  144.     testButtons()
  145.     Nr=GID.Anzahl
  146. end
  147. return(0)
  148.  
  149.  
  150. getFilename:
  151. parse arg filestring
  152. if filestring~='""' then address command 'copy "'filestring'" t:'
  153. filestring=substr(filestring, index(filestring,':')+1,length(filestring)-index(filestring,':'))
  154. filestring='t:'||substr(filestring, lastpos('/',filestring)+1, length(filestring)-lastpos('/',filestring))
  155. return(filestring)
  156.  
  157.  
  158. testButtons:
  159. if length(savefile)>6 & Anzahl>1 then call topipe('id 'gifgad' dis 0 ref')
  160. else call topipe('id 'gifgad' dis 1 ref')
  161.  
  162. if Anzahl>0 then do
  163.     call topipe('id 'cleargad' dis 0 ref')
  164.     call topipe('id 'delgad' dis 0 ref')
  165.     call topipe('id 'savegad' dis 0 ref')
  166.     call topipe('id 'browser' dis 0 ref')
  167.     call topipe('id 'dispgad' dis 0 ref')
  168.     call topipe('id 'checkers' dis 0 ref')
  169.     call topipe('id 'loopgad' dis 0 ref')
  170.     call topipe('id 'kopie' dis 1 ref')
  171.     if transparenz=1 then call topipe('id 'transgad' dis 0 ref')
  172. end
  173. else do
  174.     call topipe('id 'kopie' dis 0 ref')
  175.     call topipe('id 'cleargad' dis 1 ref')
  176.     call topipe('id 'delgad' dis 1 ref')
  177.     call topipe('id 'savegad' dis 1 ref')
  178.     call topipe('id 'browser' dis 1 ref')
  179.     call topipe('id 'dispgad' dis 1 ref')
  180.     call topipe('id 'checkers' dis 1 ref')
  181.     call topipe('id 'transgad' dis 1 ref')
  182.     call topipe('id 'loopgad' dis 1 ref')
  183. end
  184. return(0)
  185.  
  186.  
  187.  
  188.  
  189. readList:
  190. do i=1 to Anzahl
  191.     call writeln(ca,'id 'GID.i' read sort 0')
  192.     pfad.i = readln(ca)
  193.     call writeln(ca,'id 'GID.i' read sort 1')
  194.     delay.i = readln(ca)
  195. end
  196. return(0)
  197.  
  198.  
  199.  
  200.  
  201. cleanUpTemp:
  202. do i=1 to Anzahl
  203.     call writeln(ca,'id 'GID.i' read sort 0')
  204.     pfad.i = readln(ca)
  205.     address command 'delete 'pfad.i
  206. end
  207. return(0)
  208.  
  209.  
  210.  
  211.  
  212. neuOrdnen:
  213. parse arg index
  214. do i=1 to Anzahl+2
  215.     if GID.i=index then do
  216.         treffer=i
  217.         break
  218.     end
  219. end
  220. do i=treffer to Anzahl
  221.     GID.i=GID.i+1
  222. end
  223. return(0)
  224.  
  225.  
  226.  
  227.  
  228. topipe:
  229. parse arg out
  230. call writeln(ca,out)
  231. res=readln(ca)
  232. parse var res res1 res2 .
  233. if res1='ok' then return(res2)
  234. say 'error from: 'out
  235. say '  responce: ' res
  236. exit
  237.